package com.koron.css2.newProjectCenter.callback;

import com.koron.css2.newProjectCenter.bean.PjInfoBean;
import com.koron.css2.newProjectCenter.mapper.PjInfoMapper;
import com.koron.css2.newProjectCenter.service.PjInfoService;
import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.util.Constant;
import org.koron.ebs.mybatis.SessionFactory;
import org.springframework.stereotype.Service;
import org.swan.bean.MessageBean;

/**
 * 资料归档节点回调
 */
@Service(PjInfoService.DATA_ARCHIVE)
public class DataArchiveCallback implements IPjInfoNodeCallback{

    @Override
    public MessageBean callback(SessionFactory factory, PjInfoBean pjInfoBean, UserInfoBean userInfo) {
        PjInfoMapper pjInfoMapper = factory.getMapper(PjInfoMapper.class);
        pjInfoBean.setTerminationFlag(1);
        pjInfoBean.setDelayFlag(1);
        pjInfoMapper.update(pjInfoBean);
        return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "success", Void.class);
    }
}
